package com.handinglian.task.service;


import com.handinglian.common.dto.CommonPage;
import com.handinglian.servicerecord.dto.TaskIndexDto;
import com.handinglian.task.dto.*;
import com.handinglian.task.entity.TaskInfo;
import com.handinglian.task.param.TaskInfoCreateParam;
import com.handinglian.task.param.TaskInfoUpdateParam;
import org.springframework.ui.ModelMap;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Future;

public interface TaskInfoService {
    Integer createTaskInfo(TaskInfoCreateParam roleCreateParam, Integer userId);

    int updateTaskInfo(TaskInfoUpdateParam roleUpdateParam);

    int deleteTaskInfo(Integer taskId);

    TaskInfoDetailDto loadTaskInfoDetail(Integer taskId);

    TaskInfoDetailDto getDetailApp(Integer userId, Integer taskId);

    CommonPage<TaskInfoDto> inquireTaskInfoPageList(Integer userId, String titleOrDesc, String startDate, String endDate, String sortField, String sortOrder, String taskState, Integer pageIndex, Integer pageSize);

    /**
    * 查询该人员是否有待呼任务
    * @author pxl
    * @param userId
    * @return boolean true有待呼任务 false无待呼任务
    * @date 2019/10/6 14:39
    */
    boolean hasTask(Integer userId);

    List<TaskInfoDto> inquireTaskInfoListByTaskState(Integer taskState, Integer userId, String taskTitle);

    CommonPage<AssignDto> inquireAssignPageList(Integer taskId, String customerNameOrPhone, String userNameOrJobNum, String sortField, String sortOrder, String phoneStatus, String customerIntentions, Integer valid, Integer pageIndex, Integer pageSize);

    List<AssignAppDto> inquireAssignAppList(Integer userId, Integer taskId, String customerNameOrPhone, Integer callState, Integer userTagId);

    AssignDetailAppDto loadAssignAppDetail(Integer userId, Integer taskUserId);

    List<AssignDetailDto> loadAssignDetail(Integer taskUserId);

    ImportTaskDto importTaskTemplateExcel(Integer taskId, ModelMap map, HttpServletRequest request, HttpServletResponse response, MultipartFile file, Integer flag) throws Exception;

    void exportAssignInfo(Integer taskId,  ModelMap map, HttpServletRequest request, HttpServletResponse response);

    Future<Integer> count();

    Future<Integer> countExecutory();

    Future<Integer> countReadyAssign();

    Future<Integer> countReadyStart();

    Future<Integer> countOverdue();

    List<TaskInfo> list(Collection<Integer> taskIds);

    Future<List<TaskIndexDto>> listTaskIndexDto();

    Future<Integer> countCustomer();
}
